package com.djq.hhc.holder;

import com.djq.hhc.dto.UserInfoDto;

/**
 * Created with IntelliJ IDEA.
 *
 * @Author: dadd7
 * @Date: 2023/02/26/下午 9:03
 * @Description:
 */
public class UserHolder {
    private static final ThreadLocal<UserInfoDto> tl = new ThreadLocal<>();

    public static void saveUser(UserInfoDto userInfoDto){
        tl.set(userInfoDto);
    }

    public static UserInfoDto getUser(){
        return tl.get();
    }

    public static void removeUser(){
        tl.remove();
    }
}
